package br.eng.megaprojetos.view;

import org.springframework.context.annotation.Scope;
import org.zkoss.zk.ui.Component;

import br.com.vexillum.util.ReflectionUtils;
import br.com.vexillum.util.SpringFactory;
import br.eng.megaprojetos.control.ProtocolController;
import br.eng.megaprojetos.model.Protocol;

@SuppressWarnings("serial")
@org.springframework.stereotype.Component
@Scope("prototype")
public class ProtocolComposer extends BaseMegaComposer<Protocol, ProtocolController>{

	@Override
	public void doAfterCompose(Component comp) throws Exception {
		super.doAfterCompose(comp);
		loadBinder();
	}
	
	@Override
	protected String getUpdatePage() {
		return "/paginas/protocolo/modalCadastrar.zul";
	}

	@Override
	protected String getDeactivationMessage() {
		return "Deseja desativar o protocolo?";
	}

	@Override
	public ProtocolController getControl() {
		return SpringFactory.getController("protocolController", ProtocolController.class, ReflectionUtils.prepareDataForPersistence(this));
	}

	@Override
	public Protocol getEntityObject() {
		return new Protocol();
	}

}
